home *** CD-ROM | disk | FTP | other *** search
- /*
- File: DriverGestalt.h
-
- Copyright: © 1984-1994 by Apple Computer, Inc.
- All rights reserved.
-
- Version: Drivers Development Kit Release. Friday, October 21, 1994.
-
- Bugs?: If you find a problem with this file, send the file and version
- information (from above) and the problem description to:
-
- Internet: apple.bugs@applelink.apple.com
- AppleLink: APPLE.BUGS
-
- */
- /*
- * Edit History
- * 1995.03.02 MM/AF Typo - fixed
- */
-
- #ifndef __DRIVERGESTALT__
- #define __DRIVERGESTALT__
-
- /* This used to be defined in Files.h */
- #define ParamBlockHeader \
- QElemPtr qLink; /* queue link in header */\
- short qType; /* type byte for safety check */\
- short ioTrap; /* FS: the Trap */\
- Ptr ioCmdAddr; /* FS: address to dispatch to */\
- ProcPtr ioCompletion; /* completion routine addr (0 for synch calls) */\
- OSErr ioResult; /* result code */\
- StringPtr ioNamePtr; /* ptr to Vol:FileName string */\
- short ioVRefNum; /* volume refnum (DrvNum for Eject and MountVol) */
-
- /* The Driver Gestalt bit in the dCtlFlags */
-
- enum {
- DriverGestalt_Enable = 2,
-
- DriverGestalt_Enable_Mask = (1 << DriverGestalt_Enable)
- };
-
- /* New csCodes */
- enum {
- csDriverGestaltCode = 43, /* various uses */
- csDriverConfigureCode = 43, /* various uses */
- csSetStartupDrive = 44, /* Control call made to a driver when a user selects a drive in the Startup CP */
- csLowPowerMode = 70, /* Sets/Returns the current energy consumption level */
- csReturnDeviceID = 120, /* returns SCSI DevID in csParam[0] */
- csGetCDDeviceInfo = 121 /* returns CDDeviceCharacteristics in csParam[0] */
- };
-
- /* Currently defined drvrGestalt selectors */
- enum {
- driverGestaltSync = 'sync', /* True if driver only behaves synchronously. */
- driverGestaltBoot = 'boot', /* value to place in PRAM for this drive (long) */
- driverGestaltDeviceType = 'devt', /* The type of device the driver is driving. */
- driverGestaltInterface = 'intf', /* The underlying interface that the driver is using (if any) */
- driverGestaltVersion = 'vers', /* Version number of the driver (numeric part of vers resource) */
- driverGestaltStorage = 'lpwr' /* The driver supports the new power saving control/status call */
- };
-
- /* Structures for currently defined drvrGestalt selectors */
-
- struct DriverGestaltSyncResponse
- {
- Boolean behavesSynchronously;
- };
- typedef struct DriverGestaltSyncResponse DriverGestaltSyncResponse;
-
- struct DriverGestaltLpwrResponse
- {
- Boolean supportsLowPower;
- };
- typedef struct DriverGestaltLpwrResponse DriverGestaltLpwrResponse;
-
- struct DriverGestaltBootResponse
- {
- UInt8 extDev; /* Packed target (upper 5 bits) LUN (lower 3 bits) */
- UInt8 partition; /* Unused */
- UInt8 SIMSlot; /* Slot */
- UInt8 SIMsRSRC; /* sRsrcID */
- };
- typedef struct DriverGestaltBootResponse DriverGestaltBootResponse;
-
- struct DriverGestaltDevTResponse
- {
- OSType deviceType;
- };
- typedef struct DriverGestaltDevTResponse DriverGestaltDevTResponse;
-
- /* Currently defined values: */
- /* 'disk' - standard r/w disk drive */
- /* 'tape' - tape drive */
- /* 'prnt' - printer */
- /* 'proc' - processor */
- /* 'worm' - write-once */
- /* 'cdrm' - cd-rom drive */
- /* 'flop' - floppy disk drive */
- /* 'scan' - scanner */
-
-
- struct DriverGestaltIntfResponse
- {
- OSType interfaceType;
- };
- typedef struct DriverGestaltIntfResponse DriverGestaltIntfResponse;
-
- /* Currently defined values: */
- /* 'scsi' */
- /* 'pcmc' - pcmcia */
- /* 'ide ' */
- /* 'pci ' */
- /* 'nbus' - nubus card */
-
-
- struct DriverGestaltVersResponse
- {
- NumVersion driverVersion;
- };
- typedef struct DriverGestaltVersResponse DriverGestaltVersResponse;
-
-
- /* status parameter block for drvrGestalt calls */
- struct DriverGestaltParam {
- ParamBlockHeader
- short ioCRefNum; /* refNum for I/O operation */
- short csCode; /* == DriverGestaltCode */
- OSType driverGestaltSelector; /* 'sync', 'vers', etc. */
- UInt32 driverGestaltResponse; /* Could be a pointer, bit field or other format */
- };
- typedef struct DriverGestaltParam DriverGestaltParam;
-
- /* control parameter block for drvrGestalt calls */
- struct DriverConfigParam {
- ParamBlockHeader
- short ioCRefNum; /* refNum for I/O operation */
- short csCode; /* == DriverGestaltCode */
- OSType driverConfigSelector; /* the selector */
- UInt32 driverConfigParameter; /* Could be a pointer, bit field or other format */
- };
- typedef struct DriverConfigParam DriverConfigParam;
-
- /* Power Saving stuff */
-
- enum {
- pmActive = 0, /* Normal operation */
- pmStandbay = 1, /* Minimal energy saving state, can go active in 5s */
- pmIdle = 2, /* Substantial energy savings, can go active in 15s */
- pmSleep = 3 /* Maximum energy savings, device may be turned off */
- };
-
- struct LowPowerMode
- {
- UInt8 mode;
- };
- typedef struct LowPowerMode LowPowerMode;
-
-
- /* CD-ROM Specific cs*/
-
- struct CDDeviceCharacteristics
- {
- UInt8 speedMajor; /* High byte of fixed point number containing drive speed */
- UInt8 speedMinor; /* Low byte of "" CD 300 == 2.2, CD_SC == 1.0 etc. */
- UInt16 cdFeatures; /* Flags field for features and transport type of this CD-ROM */
- };
- typedef struct CDDeviceCharacteristics CDDeviceCharacteristics;
-
- enum
- {
- cdFeatureFlagsMask = 0xFFFC, /* The Flags are in the first 14 bits of the cdFeatures field */
- cdTransportMask = 0x0003 /* The transport type is in the last 2 bits of the cdFeatures field */
- };
-
- enum /* Flags for CD Feature Flags field */
- {
- cdMute = 2, /* The following flags have the same bit number */
- cdLeftPlusRight = 3, /* as the Audio Mode they represent. Don't change */
- cdSCSI_2 = 10, /* Supports SCSI2 CD Command Set */
- cdStereoVolume = 11, /* Can support two different volumes (1 on each channel) */
- cdDisconnect = 12, /* Drive supports disconnect/reconnect */
- cdWriteOnce = 13, /* Drive is a write/once (CD-R?) type drive */
-
- cdMute_Mask = 1 << cdMute,
- cdLeftPlusRight_Mask = 1 << cdLeftPlusRight,
- cdSCSI_2_Mask = 1 << cdSCSI_2,
- cdStereoVolume_Mask = 1 << cdStereoVolume,
- cdDisconnect_Mask = 1 << cdDisconnect,
- cdWriteOnce_Mask = 1 << cdWriteOnce
- };
-
- enum /* Transport types */
- {
- cdCaddy = 0, /* CD_SC,CD_SC_PLUS,CD-300 etc. */
- cdTray = 1, /* CD_300_PLUS etc. */
- cdLid = 2 /* Power CD - eg no eject mechanism */
- };
-
- #endif /* __DRIVERGESTALT__ */
-